import {createStore,combineReducers} from 'redux'
import { persistStore, persistReducer } from 'redux-persist'
import storage from 'redux-persist/lib/storage/session' // defaults to localStorage for web

import {userInfo} from './reducer/index'
const persistConfig = {
    key: 'root',
    storage,
}

const rootReducers = combineReducers({userInfo})

const persistedReducer = persistReducer(persistConfig, rootReducers)

// const store = createStore(rootReducers)

let store = createStore(persistedReducer)
let persistor = persistStore(store)

export {store,persistor};